package com.dcrzl.shcz.common.utils;



import lombok.Data;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;

/**
 * @author 稻草人之恋
 * @version 1.0
 * @date 2020/12/24 10:52
 * 响应数据封装类
 **/
@Data
@Accessors(chain = true)
@ToString
public class Result<T> implements Serializable {

	private static final long serialVersionUID = -1387824061906626473L;

	public Result(){
		this.success = true;
		this.code = SysConstant.SUCCESS_CODE_RES;
	}
	public Result<T> ok(){
		this.msg = "ok";
		return this;
	}

	/**
	 * 响应状态
	 */
	private boolean success;
	/**
	 * 响应状态描述
	 */
	private String msg;
	/**
	 * 响应数据
	 */
	private T data;
	/**
	 * 响应状态码
	 */
	private int code;

}
